package minidb.parse.exps;
import java.util.*;

public class FieldList
{
	public List<Field> fieldList;

	public FieldList()
	{
		this.fieldList = new ArrayList<Field>();
	}

	public FieldList AddField(Field f)
	{
		this.fieldList.add(f);
		return this;
	}

	public List<Field> GetFieldList()
	{
		return this.fieldList;
	}

	public String Print()
	{
		StringBuilder sb=new StringBuilder("");
		
		for(int i=0;i<this.fieldList.size();i++)
		{
			Field f=this.fieldList.get(i);
			sb.append(f.Print());
			if(i!=this.fieldList.size()-1)
				sb.append(",");
		}
		
		return sb.toString();
	}
	
	
	public String Print_Base()
	{
		StringBuilder sb=new StringBuilder("");
		
		for(int i=0;i<this.fieldList.size();i++)
		{
			Field f=this.fieldList.get(i);
			sb.append(f.Print_Base());
			if(i!=this.fieldList.size()-1)
				sb.append(",");
		}
		
		return sb.toString();
	}
}




